<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue</title>
    <style>
      .tab{
        width:20%;
        border:1px solid lightcoral;
      }
    </style>
  </head>
  <body>
    <div id="app">
     <button v-for="tab in tabs" @click="activeTab=tab">{{tab}}</button>
     <div :class="['tab']">
      {{tabs.find(item=>item === activeTab)}}页签的内容
     </div>
     <div v-for="tab in tabs" v-if="tab === activeTab" v-bind:class="['tab']">
      {{tab}}页签的内容
     </div>
    </div>
    <script src="vue.js"></script>
    <script>
      var vm = new Vue({
        el: "#app",
        data: {
         tabs:['tab1','tab2','tab3'],//标签页的数组
         activeTab:'tab1'//当前活动的标签页
        }
      });
    </script>
  </body>
</html>
